\chapter{Introduction}

\section{Forth, the Language}

\subsection{Why Forth?}

Forth is a different language. It's aged and a little weird.

What's cool about it? It's a very low-level and minimal language without any automatic memory management. At the same time, it easily scales to become a very high-level and domain-specific language, much like Lisp. 

Compared to C64 Basic, Forth is more attractive in almost every way. It is a lot more fast, memory effective and powerful.

Compared to C, specifically cc65, the story is a little different. It's hard to make a fair comparison. Theoretically Forth code can be very memory efficient, and it's possible to make Forth code that is leaner than C code. But it is also true that cc65 code is generally much faster than Forth code.

The main advantage of Forth is that the compiler can run on the actual machine. It would hardly be possible to write a C compiler that runs on a standard C64. But with Forth, it's possible to create an entire development suite with editor, compiler and assembler, that runs entirely on the C64.

Another advantage is that Forth has an interpreter. It can be really nice to make small edits and tests without going through the entire edit-compile-link-run-test loop.

For a Forth introduction, please refer to the excellent \href{http://www.forth.com/starting-forth/}{Starting Forth} by Leo Brodie. As a follow-up, I recommend \href{http://thinking-forth.sourceforge.net/}{Thinking Forth} by the same author.


\subsection{Comparing to other Forths}

There are other Forths for c64, most notably Blazin' Forth. Blazin' Forth is excellent, but durexForth has some advantages:

\begin{itemize}
\item Store your Forth sources as text files - no crazy block file system.
\item durexForth is less bloated.
\item The editor is a vi clone.
\item It's open source (available at \href{http://code.google.com/p/durexforth/}{Google Code}).
\end{itemize}


\subsection{Stack Checking}

durexForth should be one of the fastest and leanest Forths for the C64. To achieve this, there are not too many niceties for beginners. For example, there are no checks for stack overflow and underflow. Since the parameter stack is placed in zeropage for best performance, this means that the system will blow up if you do too many pops or pushes. This is not much of a problem for an experienced Forth programmer, but until you reach that status, handle the stack with care.
